<?php
    /**
     * CategoryController.php
     *
     * Part of m.beetobees
     *
     * 模版、用户案例、发布行业类别
     *
     * @author    xiaxianmao <xiaxianmao@cyou-inc.com>
     * @copyright changyou.com
     * @date      2016-12-05
     * @link      
     */
    namespace App\Http\Controllers;

    use Illuminate\Http\Request;
    use App\Http\Models\CategoryModel;

    class CategoryController extends Controller
    {

        // 用户案例 小编推荐 类别列表
        public function caselist(Request $request)
        {
            try{
                $ret = CategoryModel::get_all();
                unset($ret[4]); // 去除行业
                return response()->json(build_result(["info"=>$ret]));
            } catch(\Exception $e) {
                return response()->json(build_result('', '10001', $e->getMessage()));   
            }
        }

        // 模板库类别
        public function template(Request $request)
        {
            //只要行业
            try{
                $ret = CategoryModel::get_all();
                unset($ret[1], $ret[3], $ret[4]); // 去除节日、玩法、场景
                return response()->json(build_result(["info"=>$ret]));
            } catch(\Exception $e) {
                return response()->json(build_result('', '10001', $e->getMessage()));   
            }
        }
    }

    
